package cn.est.controller;

import cn.est.dto.Result;
import cn.est.service.HomeService;
import cn.est.util.ResultUtil;
import cn.est.vo.ClassifyVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class HomeController {
    @Autowired
    private HomeService homeService;

    @GetMapping("/api/home/classifyTree")
    public Result classifyTree() {
        List<ClassifyVO> classifyTree = homeService.getClassifyTree();
        return ResultUtil.success(classifyTree);
    }
}
